<template>
  <div>
    <el-tabs type="border-card" :stretch="true" @tab-click="tabsEvent">
      <el-tab-pane label="宿舍运动员"><keep-alive><dorm2player v-if="index == 0" /></keep-alive></el-tab-pane>
      <el-tab-pane label="宿舍管理"><keep-alive><dorm v-if="index == 1" /></keep-alive></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import dorm from "@/components/Dorm/dorm.vue"
  import dorm2player from "@/components/Dorm/dorm2player.vue"
  export default {
    components: {
      dorm,
      dorm2player
    },
    data() {
      return {
        index: 0
      }
    },
    methods:{
      tabsEvent(e){
        this.index = e.index
      },
    },
  }
</script>

<style>
</style>
